{php}
    $importDaterangePicker = 1;
      if (strpos($field['name'],'[')) {
        $field['id']=str_replace(']','',str_replace('[','',$field['name']));
      }else{
        $field['id']=$field['name'];
      }
{/php}
<input type="text" id="{$field.id}" class="form-control input time" name="{$field.name}" value="{notempty name='field.value'}{$field.value}{/notempty}" {$field.extra_attr|default=''}>
{if condition="$importDaterangePicker"}
<link href="__LIBS__/daterangepicker/daterangepicker-bs3.css" type="text/css" rel="stylesheet">
<script src="__LIBS__/daterangepicker/moment.min.js"></script>
<script src="__LIBS__/daterangepicker/daterangepicker.js"></script>
{/if}
<script type="text/javascript">
    $(function(){
        $('#{$field.id}').daterangepicker({
          format:"YYYY-MM-DD",
          singleDatePicker: false,
          showDropdowns: true,
          minDate:'2000-01-01',
          maxDate:'2030-01-01',
          startDate:'2016-01-01',
              showWeekNumbers: true,
              timePicker: false,
              timePickerIncrement: 1,
              timePicker12Hour: true,
              ranges: {
                 '今天': [moment(), moment()],
                 '昨天': [moment().subtract('days', 1), moment().subtract('days', 1)],
                 '最近7天': [moment().subtract('days', 6), moment()],
                 '最近30天': [moment().subtract('days', 29), moment()],
                 '上一个月': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
              },
              opens: 'right',
            locale : {
                  applyLabel : '确定',
                  cancelLabel : '取消',
                  fromLabel : '起始时间',
                  toLabel : '结束时间',
                  customRangeLabel : '自定义',
                  daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
                  monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
                  firstDay : 1
              }
        });
    });
</script>